package com.jiegui.wx.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jiegui.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.jiegui.wx.mapper.WechatGroupingMapper;
import com.jiegui.wx.domain.WechatGrouping;
import com.jiegui.wx.service.WechatGroupingService;

/**
 * 微信客服分组Service业务层处理
 * 
 * @author wuqicheng
 * @date 2021-12-14
 */
@Service
public class WechatGroupingServiceImpl extends ServiceImpl<WechatGroupingMapper, WechatGrouping> implements WechatGroupingService
{
    @Resource
    private WechatGroupingMapper wechatGroupingMapper;

    /**
     * 查询微信客服分组
     * 
     * @param id 微信客服分组主键
     * @return 微信客服分组
     */
    @Override
    public WechatGrouping selectWechatGroupingById(Long id)
    {
        return wechatGroupingMapper.selectById(id);
    }

    /**
     * 查询微信客服分组列表
     * 
     * @param wechatGrouping 微信客服分组
     * @return 微信客服分组
     */
    @Override
    public List<WechatGrouping> selectWechatGroupingList(WechatGrouping wechatGrouping)
    {
        return wechatGroupingMapper.selectWechatGroupingList(wechatGrouping);
    }

    /**
     * 新增微信客服分组
     * 
     * @param wechatGrouping 微信客服分组
     * @return 结果
     */
    @Override
    public int insertWechatGrouping(WechatGrouping wechatGrouping)
    {
        return wechatGroupingMapper.insert(wechatGrouping);
    }

    /**
     * 修改微信客服分组
     * 
     * @param wechatGrouping 微信客服分组
     * @return 结果
     */
    @Override
    public int updateWechatGrouping(WechatGrouping wechatGrouping)
    {

        return wechatGroupingMapper.updateById(wechatGrouping);
    }

    /**
     * 批量删除微信客服分组
     * 
     * @param ids 需要删除的微信客服分组主键
     * @return 结果
     */
    @Override
    public int deleteWechatGroupingByIds(Long[] ids)
    {
        return wechatGroupingMapper.delete(new LambdaQueryWrapper<WechatGrouping>().in(WechatGrouping::getId,ids));
    }

    /**
     * 删除微信客服分组信息
     * 
     * @param id 微信客服分组主键
     * @return 结果
     */
    @Override
    public int deleteWechatGroupingById(Long id)
    {
        return wechatGroupingMapper.deleteById(id);
    }
}
